package entity

import (
	"encoding/xml"
)

type ReqPreOrder struct {
	XMLName      xml.Name      `xml:"request"`
	OrderID      string        `xml:"order_id"`                   
	CargoName    string        `xml:"cargo_name"`                 
	ContactInfos []ContactInfo `xml:"contact_infos>contact_info"` 
	MonthlyCard  string        `xml:"monthly_card"`               
	ExpressType  int           `xml:"express_type"`               
}

type ContactInfo struct {
	ContactType int    `xml:"contact_type"` 
	Tel         string `xml:"tel"`          
	Province    string `xml:"province"`     
	City        string `xml:"city"`         
	County      string `xml:"county"`       
	Address     string `xml:"address"`      
}

type ReqPickOrder struct {
	XMLName xml.Name  `xml:"request"`
	Head    string    `xml:"head"`
	Order   PickOrder `xml:"order"`
}

type PickOrder struct {
	XMLName       xml.Name    `xml:"order"`
	OrderCode     string      `xml:"order_code"`
	Sender        OrderAddr   `xml:"sender_info"`
	Delivery      OrderAddr   `xml:"delivery_info"`
	Products      []SFProduct `xml:"products>product"`
	ExpCom        string      `xml:"express_company"`
	SendStartTime string      `xml:"send_start_time"`
}

type OrderAddr struct {
	Name     string `xml:"name"`
	Province string `xml:"province"`
	City     string `xml:"city"`
	County   string `xml:"county"`
	Tel      string `xml:"tel"`
	Detail   string `xml:"detail"`
}

type SFProduct struct {
	ProdId string `xml:"product_id"`
	Name   string `xml:"product_name"`
	Title  string `xml:"product_title"`
	Price  float64 `xml:"product_price"`
	Num    int `xml:"product_num"`
}

type WkStNtfReq struct {
	XMLName    xml.Name `xml:"Request"`
	Head       string   `xml:"head"`
	WbillNo    string   `xml:"waybill_no"`
	OrderCode  string   `xml:"order_code"`
	OriginCode string   `xml:"cust_order_code"`
	Status     string   `xml:"status"`
	Desc       string   `xml:"status_desc"`
}

type OrderStNtfReq struct {
	XMLName        xml.Name `xml:"Request"`
	OrderNo        string   `xml:"orderNo"`
	WaybillNo      string   `xml:"waybillNo"`
	OrderStateCode string   `xml:"orderStateCode"`
	OrderStateDesc string   `xml:"orderStateDesc"`
	EmpCode        string   `xml:"empCode"`
	EmpPhone       string   `xml:"empPhone"`
	NetCode        string   `xml:"netCode"`
	LastTime       string   `xml:"lastTime"`
	BookTime       string   `xml:"bookTime"`
	CarrierCode    string   `xml:"carrierCode"`
	CustOrderCode  string   `xml:"custOrderCode"`
}

type ExpressSignNtfReq struct {
	XMLName       xml.Name `xml:"Request"`
	Type          int      `xml:"type"`
	CustOrderCode string   `xml:"cust_order_code"`
	WaybillNo     string   `xml:"waybill_no"`
	OrderStatus   string   `xml:"order_status"`
	SignTime      string   `xml:"sign_time"`
}

type AddressXMLRep struct {
	XMLName      xml.Name                   `xml:"Request"`
	ExpressType  string                     `xml:"express_type"`
	ContactInfos []AddressXMLReqContactInfo `xml:"contact_infos>contact_info"`
}

type AddressXMLReqContactInfo struct {
	ContactType int    `xml:"contact_type"`
	Tel         string `xml:"tel"`
	Province    string `xml:"province"`
	City        string `xml:"city"`
	County      string `xml:"county"`
	Address     string `xml:"address"`
}

type AddressXMLResp struct {
	XMLName xml.Name `xml:"Response"`
	Head    string   `xml:"head"`
	Code    string   `xml:"code"`
	ErrMsg  string   `xml:"err_msg"`
}

type ExpressBackBindReq struct {
	XMLName               xml.Name `xml:"Request"`
	FirstCustomOrderCode  string   `xml:"first_cust_order_code"`  // 第一层客户订单号
	FirstWaybillNo        string   `xml:"first_waybill_no"`       // 第一层运单号
	SecondCustomOrderCode string   `xml:"second_cust_order_code"` // 第二层客户订单号
	SecondWaybillNo       string   `xml:"second_waybill_no"`      // 第二层运单号
	OrderTime             string   `xml:"order_time"`             // 第二层订单下单时间
}
